package com.ruo.goods.service.impl;

import com.ruo.common.core.domain.R;
import com.ruo.goods.domain.PmsBrand;
import com.ruo.goods.mapper.PmsBrandMapper;
import com.ruo.goods.service.PmsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：尚志豪
 * @Package：com.ruo.goods.service.impl
 * @Project：ruoi
 * @name：PmsBrandServiceImpl
 * @Date：2024/7/21 10:33
 */
@Service
public class PmsBrandServiceImpl implements PmsBrandService {
    @Autowired
    private PmsBrandMapper pmsBrandMapper;
    /**
     * 商品品牌列表
     */
    @Override
    public List<PmsBrand> pmsBrandList() {
        return pmsBrandMapper.pmsBrandList();
    }
    /**
     * 商品品牌添加
     */
    @Override
    public R pmsBrandAdd(PmsBrand pmsBrand) {
        int i = pmsBrandMapper.pmsBrandAdd(pmsBrand);
        if (i>0){
            return R.ok("商品品牌添加成功");
        }
        return R.fail("商品品牌添加失败");
    }
    /**
     * 商品品牌删除
     */
    @Override
    public R pmsBrandDel(Integer id) {
        int i = pmsBrandMapper.pmsBrandDel(id);
        if (i>0){
            return R.ok("商品品牌删除成功");
        }
        return R.fail("商品品牌删除失败");
    }
    /**
     * 商品品牌修改
     */
    @Override
    public R pmsBrandUpdate(PmsBrand pmsBrand) {
        int i = pmsBrandMapper.pmsBrandUpdate(pmsBrand);
        if (i>0){
            return R.ok("商品品牌修改成功");
        }
        return R.fail("商品品牌修改失败");
    }
    /**
     * 商品品牌回显
     */
    @Override
    public PmsBrand pmsBrandEcho(Integer id) {
        PmsBrand r = pmsBrandMapper.pmsBrandEcho(id);
        return r;
    }
}
